package com.baihan.angus.app.game.busshow.ui.user;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;

import com.baihan.angus.app.game.basic.base.view_model.BaseViewModel;
import com.baihan.angus.app.game.basic.utils.Tooast;
import com.baihan.angus.app.game.basic.utils.net.ApiObserver;
import com.baihan.angus.app.game.common.bean.response.VerifyStatusResponse;
import com.baihan.angus.app.game.common.data_center.remote.RemoteDataMng;

public class UserVM extends BaseViewModel {

    public UserVM(@NonNull Application application) {
        super(application);
    }

    public MutableLiveData<VerifyStatusResponse.Data> mldStatus = new MutableLiveData<>();

    public void getVerifyStatus(String id) {
        showLoading("getVerifyStatus");
        RemoteDataMng.getInstance().getVerifyStatus(id, mLifecycleProvider.bindToLifecycle(), new ApiObserver<VerifyStatusResponse>() {
            @Override
            public void onSuccess(VerifyStatusResponse verifyStatusResponse) {
                hideLoading("getVerifyStatus");
                mldStatus.setValue(verifyStatusResponse.getData());
            }

            @Override
            public void onFailed(int code, String msg) {
                hideLoading("getVerifyStatus");
                Tooast.warning(msg);
                mldStatus.setValue(null);
            }
        });
    }
}
